package com.nut.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nut.article.entity.Article;
import com.nut.article.entity.ArticleVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper extends BaseMapper<Article> {

    List<ArticleVo> selectListPage(Page page, @Param("tagId") Integer tagId);

    List<ArticleVo> selectSideList();

    List<ArticleVo> selectHotList();

    List<ArticleVo> selectTopList();

    List<ArticleVo> selectNewList();

    List<ArticleVo> searchList(@Param("keywords") String keywords);

    /**
     * 重置某个类型的积分
     * @param types
     */
    void resetSort(@Param("types") String types);

    /**
     * 给 某个类似 设置排序积分
     * @param types
     * @param score
     */
    void updateSort(@Param("types") String types, @Param("id") Integer id, @Param("score") Integer score);

}
